#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "setdialog.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::on_btnOpen_clicked()
{
    setDialog dlg;
    //信号链接
    connect(&dlg, &setDialog::sig_addOne,[=](int value){
        ui->lineEdit->setText(QString::number(value));
    });

    dlg.exec(); //事件循环，阻塞UI
}
